CFLAGS = -Wall -O2 -pipe
LDFLAGS = -lusb-1.0 -pthread -lm -s

NBIS_REFS = nbis/libnbis.o nbis/libbozorth3/libbozorth3.o nbis/libmindtct/libmindtct.o

all: upekux upekuxd

#upekux
upekux:   upekux.o ipc_security.o
upekux.o: ipc.h

#upekuxd
upekuxd:  upekuxd.o auth.o driver.o fingerdb.o udf_crc.o uinputux.o ipcd.o ipc_security.o launcherd.o ${NBIS_REFS}
auth.o: launcherd.h
driver.o: driver.h protocol.h uinputux.o uinputux.h
fingerdb.o: fingerdb.h
ipcd.o:   driver.h ipc.h
launcherd.o: launcherd.h

#nbis
nbis/libmindtct/libmindtct.o:
	cd nbis/libmindtct && ${MAKE}

nbis/libbozorth3/libbozorth3.o:
	cd nbis/libbozorth3 && ${MAKE}

PHONY: clean
clean:
	rm -f *.o upekuxd upekux
	cd nbis && ${MAKE} clean
	cd nbis/libmindtct && ${MAKE} clean
	cd nbis/libbozorth3 && ${MAKE} clean
